
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>附：基础环境搭建 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="integration/passport.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    概要
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="architecture.html">
            
                <a href="architecture.html">
            
                    
                    总体架构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="quick-start.html">
            
                <a href="quick-start.html">
            
                    
                    快速开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="quickstart/confcenter.html">
            
                <a href="quickstart/confcenter.html">
            
                    
                    配置中心
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="quickstart/oneplatform.html">
            
                <a href="quickstart/oneplatform.html">
            
                    
                    oneplatform企业级开发平台
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="quickstart/passport.html">
            
                <a href="quickstart/passport.html">
            
                    
                    统一认证平台
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="jeesuite-lib.html">
            
                <a href="jeesuite-lib.html">
            
                    
                    jeesuite-libs使用文档
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="jeesuite-libs/common.html">
            
                <a href="jeesuite-libs/common.html">
            
                    
                    common模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="jeesuite-libs/common2.html">
            
                <a href="jeesuite-libs/common2.html">
            
                    
                    common2模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="jeesuite-libs/spring.html">
            
                <a href="jeesuite-libs/spring.html">
            
                    
                    Spring模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="jeesuite-libs/mybatis.html">
            
                <a href="jeesuite-libs/mybatis.html">
            
                    
                    mybatis模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="jeesuite-libs/cache.html">
            
                <a href="jeesuite-libs/cache.html">
            
                    
                    cache模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="jeesuite-libs/kafka.html">
            
                <a href="jeesuite-libs/kafka.html">
            
                    
                    kafka模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="jeesuite-libs/scheduler.html">
            
                <a href="jeesuite-libs/scheduler.html">
            
                    
                    scheduler模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="jeesuite-libs/filesystem.html">
            
                <a href="jeesuite-libs/filesystem.html">
            
                    
                    filesystem模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="jeesuite-libs/rest.html">
            
                <a href="jeesuite-libs/rest.html">
            
                    
                    restAPI模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="jeesuite-libs/springboot-starter.html">
            
                <a href="jeesuite-libs/springboot-starter.html">
            
                    
                    springboot-starter模块
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="integration.html">
            
                <a href="integration.html">
            
                    
                    系统集成
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="integration/confcenter.html">
            
                <a href="integration/confcenter.html">
            
                    
                    集成配置中心
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="integration/passport.html">
            
                <a href="integration/passport.html">
            
                    
                    集成认证中心
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.5" data-path="base-env-install.html">
            
                <a href="base-env-install.html">
            
                    
                    附：基础环境搭建
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >附：基础环境搭建</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x73AF;&#x5883;&#xFF1A;centos65-64&#x4F4D;">&#x73AF;&#x5883;&#xFF1A;centos6.5 64&#x4F4D;</h2>
<p>&#x7531;&#x4E8E;yum&#x76F4;&#x63A5;&#x5B89;&#x88C5;&#x7248;&#x672C;&#x7248;&#x672C;&#x4F1A;&#x6BD4;&#x8F83;&#x4F4E;&#xFF0C;&#x6240;&#x4EE5;&#x91C7;&#x7528;&#x624B;&#x52A8;&#x5B89;&#x88C5;&#x7684;&#x65B9;&#x5F0F;&#x3002;</p>
<h3 id="jdk">&#x5B89;&#x88C5;JDK </h3>
<pre><code>1.&#x4E0B;&#x8F7D;jdk rpm&#x5305;
2.chmod +x  jdk-xxx.rpm
3.rpm -ivh jdk-xxx.rpm
4.&#x914D;&#x7F6E;&#x73AF;&#x5883;&#x53D8;&#x91CF;
vi /etc/profile
-----------
export JAVA_HOME=/usr/java/jdk1.8.0_121
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
-----------
source /etc/profile
</code></pre><h3 id="mysql">&#x5B89;&#x88C5;mysql5.7 </h3>
<pre><code># &#x4E0B;&#x8F7D;mysql&#x6E90;&#x5B89;&#x88C5;&#x5305;
wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
# &#x5B89;&#x88C5;mysql&#x6E90;
yum localinstall mysql57-community-release-el7-8.noarch.rpm

&#x4EE5;&#x4E0A;&#x4E24;&#x6B65;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#xFF1A;rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm


#&#x5B89;&#x88C5;mysql-server
yum install mysql-community-server
</code></pre><p>&#x9A8C;&#x8BC1;&#x5B89;&#x88C5;&#x662F;&#x5426;&#x6210;&#x529F;</p>
<pre><code>mysql -V
</code></pre><p>&#x542F;&#x52A8;&#xFF08;&#x7B2C;&#x4E00;&#x6B21;&#x542F;&#x52A8;&#x6BD4;&#x8F83;&#x6162;&#x4F1A;&#x521D;&#x59CB;&#x5316;&#xFF09;</p>
<pre><code>service mysqld start 
-- &#x5982;&#x679C;&#x542F;&#x52A8;&#x5931;&#x8D25;&#xFF0C;&#x63D0;&#x793A;&#x201C;MySQL Daemon failed to start&#x201D;&#xFF0C;&#x53EF;&#x4EE5;&#x5C1D;&#x8BD5;&#x5148;&#x521D;&#x59CB;&#x5316;mysql&#xFF0C;&#x8F93;&#x5165;&#x547D;&#x4EE4;&#xFF1A;mysqld --initialize
</code></pre><p>&#x521D;&#x59CB;&#x5316;root&#x5BC6;&#x7801;</p>
<pre><code class="lang-ruby"><span class="hljs-comment">#&#x83B7;&#x53D6;&#x5B89;&#x88C5;&#x7684;&#x4E34;&#x65F6;&#x5BC6;&#x7801;</span>
grep <span class="hljs-string">&apos;temporary password&apos;</span> /var/log/mysqld.log
<span class="hljs-comment">#&#x767B;&#x5F55;mysql</span>
mysql -uroot -p
<span class="hljs-comment">#&#x66F4;&#x65B0;&#x5BC6;&#x7801;</span>
ALTER USER <span class="hljs-string">&apos;root&apos;</span>@<span class="hljs-string">&apos;localhost&apos;</span> IDENTIFIED BY <span class="hljs-string">&apos;&#x65B0;&#x7684;&#x5BC6;&#x7801;&apos;</span>;
</code></pre>
<p>&#x914D;&#x7F6E;</p>
<pre><code>[mysqld]
character_set_server=utf8
init_connect=&apos;SET NAMES utf8&apos;
</code></pre><h3 id="&#x5B89;&#x88C5;redis">&#x5B89;&#x88C5;redis</h3>
<pre><code>wget http://download.redis.io/releases/redis-3.2.10.tar.gz
tar -xzvf redis-3.2.10.tar.gz
cd redis-3.2.10
make
cd src
make install PREFIX=/usr/local/redis
cp ../redis.conf /etc/redis.conf
</code></pre><p>&#x53C2;&#x8003;&#x914D;&#x7F6E;</p>
<pre><code>daemonize yes
#protected-mode no
pidfile /var/run/redis/redis.pid

port 6379
#bind 120.0.0.1
timeout 0
loglevel warning

logfile /datas/logs/redis/redis.log
databases 16


save 900 1
save 300 10
save 60 10000

rdbcompression yes
dbfilename dump.rdb
dir /datas/redis/

requirepass 123456
</code></pre><p>&#x542F;&#x52A8;</p>
<pre><code>/usr/local/redis/bin/redis-server /etc/redis.conf
</code></pre><h3 id="&#x5B89;&#x88C5;zookeeper">&#x5B89;&#x88C5;zookeeper</h3>
<pre><code>wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
tar -xzvf zookeeper-3.4.10.tar.gz
cp zookeeper-3.4.10
mv conf/zoo_sample.cfg conf/zookeeper.properties
</code></pre><p>&#x542F;&#x52A8;</p>
<pre><code>./bin/zkServer.sh conf/zookeeper.properties &amp;
</code></pre><h3 id="&#x5B89;&#x88C5;kafka">&#x5B89;&#x88C5;kafka</h3>
<pre><code>wget https://www.apache.org/dyn/closer.cgi?path=/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz
tar -xzvf kafka_2.11-0.11.0.0.tgz
cp kafka_2.11-0.11.0.0
# &#x4FEE;&#x6539;&#x914D;&#x7F6E;
vi config/server.properties
</code></pre><p>&#x5173;&#x952E;&#x914D;&#x7F6E;</p>
<pre><code>broker.id=1
#advertised.host.name=192.168.1.94
#listeners=PLAINTEXT://192.168.1.94:9092
port=9092
num.network.threads=3
num.io.threads=3
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/datas/kafka-logs
num.partitions=3
num.recovery.threads.per.data.dir=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
auto.create.topics.enable=true
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=6000
</code></pre><p>&#x542F;&#x52A8;</p>
<pre><code>./bin/kafka-server-start.sh ./config/server.properties 1&gt;/dev/null 2&gt;&amp;1 &amp;
</code></pre><h3 id="window&#x5B89;&#x88C5;&#x53C2;&#x8003;&#xFF1A;">window&#x5B89;&#x88C5;&#x53C2;&#x8003;&#xFF1A;</h3>
<p>redis&#x5B89;&#x88C5; &#xFF1A;<a href="http://www.cnblogs.com/lpyan/p/5608333.html" target="_blank">http://www.cnblogs.com/lpyan/p/5608333.html</a></p>
<p>kafka&#x5B89;&#x88C5;&#xFF1A;<a href="http://blog.csdn.net/evankaka/article/details/52421314" target="_blank">http://blog.csdn.net/evankaka/article/details/52421314</a></p>
<p>zookeeper&#x5B89;&#x88C5;&#xFF1A;<a href="http://blog.csdn.net/tlk20071/article/details/52028945" target="_blank">http://blog.csdn.net/tlk20071/article/details/52028945</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="integration/passport.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 集成认证中心">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"附：基础环境搭建","level":"1.5","depth":1,"previous":{"title":"集成认证中心","level":"1.4.2","depth":2,"path":"integration/passport.md","ref":"integration/passport.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"base-env-install.md","mtime":"2017-09-16T09:20:36.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-05-04T10:30:11.187Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

